<?php
class  Front_Model_DbTable_Savedjob extends  Kieumau_Db_Common
{
    protected $_name = 'saved_job' ;
	
	public function getSavedJob($employeeId){
		try {
			$sql = 'SELECT a.job_id, b.title, c.companyname, b.expire_date, d.name as salary, e.name, a.applied_date, a.create_date, a.applied as applyStatus
					FROM `saved_job` a  
					INNER JOIN `job` b
						ON a.job_id = b.id
					INNER JOIN `employer` c
						ON b.employer_id = c.id
					INNER JOIN `salary_range` d
						ON b.salary_range_id = d.id
					INNER JOIN `province` e
						ON b.province_id = e.id
					WHERE employee_id = ?';
			$this->_db->setFetchMode(Zend_Db::FETCH_ASSOC);
			$result = $this->_db->fetchAll ( $sql, $employeeId );			
			return $result;
		} catch ( Exception $ex ) {
			echo "<br/> Can not get saved job, <br/>Error: " . $ex->getMessage ();
			exit ();
		}
	}
}